/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.hcht.xrlh.rwcx.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hcht.xrlh.rwcx.entity.Vrw;
import com.hcht.xrlh.rwcx.service.VrwService;
import com.hcht.xrlh.sx.entity.DrSx;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.web.BaseController;
import com.thinkgem.jeesite.modules.sys.utils.UserUtils;

/**
 * 双随机事项管理Controller
 * @author lrz
 * @version 2016-12-19
 */
@Controller
@RequestMapping(value = "${adminPath}/vrw/vrw")
public class VrwController extends BaseController {

	@Autowired
	private VrwService vrwService;
	
	@RequiresPermissions("vrw:vrw:view")
	@RequestMapping(value = {"list", ""})
	public String list(Vrw vrw, HttpServletRequest request, HttpServletResponse response, Model model) {
		vrw.setUserids(UserUtils.getUser().getId());
		Page<Vrw> page = vrwService.findPage(new Page<Vrw>(request, response), vrw); 
		model.addAttribute("page", page);
		return "xrlh/vrw/rwList";
	}
}